package com.time.sky.controller;

import com.time.sky.entity.House;
import com.time.sky.mapper.HouseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class HouseController {
    @Autowired
    private HouseMapper houseMapper;


    @RequestMapping("/host/selectHouse")
    private List<House> selectHouse(@RequestBody House house){
        List<House> houses = houseMapper.selectHouse(house);
        return houses;
    }

    @RequestMapping("/host/findAll")
    private List<House> findAll(){
        List<House> houses = houseMapper.findAll();
        return houses;
    }

}
